import request from '@/utils/request'

// 创建用户账单
export function createUserBill(data) {
  return request({
    url: '/finance/user-bill/create',
    method: 'post',
    data: data
  })
}

// 更新用户账单
export function updateUserBill(data) {
  console.log('API updateUserBill 发送的数据:', JSON.stringify(data, null, 2));
  return request({
    url: '/finance/user-bill/update',
    method: 'put',
    data: data
  })
}

// 删除用户账单
export function deleteUserBill(id) {
  return request({
    url: '/finance/user-bill/delete?id=' + id,
    method: 'delete'
  })
}

// 获得用户账单
export function getUserBill(id) {
  return request({
    url: '/finance/user-bill/get?id=' + id,
    method: 'get'
  })
}

// 获得用户账单分页
export function getUserBillPage(params) {
  return request({
    url: '/finance/user-bill/page',
    method: 'get',
    params
  })
}
// 导出用户账单 Excel
export function exportUserBillExcel(params) {
  return request({
    url: '/finance/user-bill/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
